package com.chen.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author chen
 * @since 2022-12-13
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("tb_department")
@ApiModel(value = "Department对象", description = "")
public class Department extends Model<Department> {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("系名")
    @TableField("name")
    private String name;

    @ApiModelProperty("系办公电话")
    @TableField("phone")
    private String phone;

    @ApiModelProperty("办公室地点")
    @TableField("address")
    private String address;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty("修改时间")
    @TableField("modified_time")
    private Date modifiedTime;

    @ApiModelProperty("系主任id，关联用户表")
    @TableField("mgr_id")
    private Long mgrId;

    @ApiModelProperty("部门数量")
    @TableField(exist = false)
    private Integer deptCount;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
